package com.buyouchina.web.interceptor;

import java.util.Map;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

public class OutletsInterceptor extends MethodFilterInterceptor {
	private static final long serialVersionUID = -782732202409715796L;


	@Override
	protected String doIntercept(ActionInvocation invocation) throws Exception {
		ActionContext context = invocation.getInvocationContext();
		Map<?,?> session=context.getSession();
		if(session.get("outlets")!=null&&session.get("user")!=null){  
			return invocation.invoke();
		}else{
			return Action.LOGIN;
		}
	}
}
